<template>
  <ChatComponent
    title="智能对话"
    :welcomeMessage="welcomeMessage"
    :onSendMessage="handleSendMessage"
  />
</template>

<script lang="ts">
import { defineComponent } from "vue";
import ChatComponent from "@/views/public/chat/chat.vue";

export default defineComponent({
  name: "ChatHome",
  components: {
    ChatComponent,
  },
  setup() {
    const welcomeMessage = "你好！我是AI助手，有什么我可以帮你的吗？";

    const handleSendMessage = async (message: string) => {
      // 这里可以调用实际的API接口
      return new Promise<string>((resolve) => {
        setTimeout(() => {
          resolve("这是一个模拟的AI回复消息。在实际应用中，这里应该调用AI接口获取真实的回复。");
        }, 1000);
      });
    };

    return {
      welcomeMessage,
      handleSendMessage,
    };
  },
});
</script>

<style lang="scss" scoped>
// 如果需要自定义样式，可以在这里添加
</style>
